package com.trsjh.db.domains;
// Generated 2012-1-13 12:55:11 by Hibernate Tools 3.4.0.CR1


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * GoodsType generated by hbm2java
 */
@Entity
@Table(name="goodsTypes"
,catalog="myglass"
, uniqueConstraints = @UniqueConstraint(columnNames="name") 
		)
public class GoodsType  implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5506936153913096048L;

	@Id @GeneratedValue(strategy=IDENTITY)
	@Column(name="id", unique=true, nullable=false)
	private Integer id;

	@Column(name="name", unique=true, nullable=false, length=50)
	private String name;

	@Column(name="description")
	private String description;

	@OneToMany(fetch=FetchType.LAZY, mappedBy="goodsType")
	private Set<Good> goods = new HashSet<Good>(0);

	public GoodsType() {
	}


	public GoodsType(String name) {
		this.name = name;
	}
	public GoodsType(String name, String description, Set<Good> goodses) {
		this.name = name;
		this.description = description;
		this.goods= goodses;
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}


	public Set<Good> getGoods() {
		return goods;
	}


	public void setGoods(Set<Good> goods) {
		this.goods = goods;
	}


	@Override
	public String toString() {
		return name + "[" + description + "]";
	}



}


